<%@ page session="false" language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="ko" >
<head>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,target-densitydpi=medium-dpi"/>
	<meta http-equiv="refresh" content="5" >
	<title>채널선택</title>
</head>
<body style="text-align: left;display: inline;">
<div align="center" >
	<h1 style="display: inline;">채널 선택</h1><button title="테스트" onclick="refresh();"  style='display: inline; background-image: url("/img/refresh.png"); height: 35px; width: 35px; position: absolute; right: 5px'></button>
</div>
<br>

<form action="/gonu/play/typeSelect.gonu">
<center>
<div align="left" style="margin-left: 5px; margin-right: 5px;">
<button type="submit" id="makeChannel" name="makeChannel" style="width: 100%; height: 50px; margin-bottom:10px ">방만들기</button>
</div>
<c:forEach items="${playChannels}" var="channel">
<div align="left" style="margin-left: 5px; margin-right: 5px;">
	<c:set var="disabled" value=""/>
	<c:if test="${channel.play ||channel.selectGameType}"><c:set var="disabled" value="disabled='disabled'"/></c:if>
	
	<c:choose>
	<c:when test="${channel.firstUser != null }">
	<c:if test="${!channel.play && !channel.selectGameType}">
		<button type="submit" value="${channel.chnlNumber }" ${disabled} id="channelNumber" name="channelNumber" style="width: 100%; height: 50px; margin-bottom:10px ">
		${channel.chnlNumber }번방 ${channel.firstUser}님대기중
		</button>
	</c:if>
	</c:when>
	<c:when test="${channel.selectGameType}">
		<button type="submit" value="${channel.chnlNumber }" ${disabled} id="channelNumber" name="channelNumber" style="width: 100%; height: 50px; margin-bottom:10px ">
		${channel.chnlNumber }번방 게임선택중
		</button>
	</c:when>
	</c:choose>
</div>
</c:forEach>
</center>
</form>

</body>
<script type="text/javascript">
function refresh() {
	location.reload(true);
}
</script>
</html>
